<nz-dropdown-menu #rightClickMenu="nzDropdownMenu" style="width:200px;">
  <ul nz-menu style="width:200px;">
    <li nz-menu-item (click)="openClick()" *ngIf="!selectedNode?.expandable">查看用户信息</li>
    <li nz-menu-item (click)="addUserClick()" *ngIf="selectedNode?.expandable">新增</li>
    <li nz-menu-item (click)="renameClick()" *ngIf="selectedNode?.expandable">重命名</li>
    <li nz-menu-item (click)="deleteClick()">删除</li>
  </ul>
</nz-dropdown-menu>
<h3>
  <i nz-icon nzType="group" nzTheme="outline" style="padding-right:5px;color: #fdca66"></i>
  用户组
  <a style="margin-left: 5px" (click)="addGroupClick()"><nz-tag><i nz-icon nzType="plus"></i>新建</nz-tag></a>
</h3>

<nz-spin nzTip="Loading..." [nzSpinning]="loading">
  <nz-tree-view [nzTreeControl]="treeControl" [nzDataSource]="dataSource" [nzDirectoryTree]="true">
  <nz-tree-node *nzTreeNodeDef="let node" nzTreeNodePadding>
    <nz-tree-node-toggle nzTreeNodeNoopToggle></nz-tree-node-toggle>
    <nz-tree-node-option
      [nzDisabled]="node.disabled"
      (contextmenu)="rightClickFile($event, rightClickMenu,node);$event.stopPropagation();"
    >
      <i nz-icon nzType="user" nzTheme="outline"></i>
      {{ node.name }}
    </nz-tree-node-option>
  </nz-tree-node>
  <nz-tree-node *nzTreeNodeDef="let node; when: hasChild" nzTreeNodePadding>
    <nz-tree-node-option
      [nzDisabled]="node.disabled"
      (click)="treeControl.toggle(node)"
      (contextmenu)="rightClickFile($event, rightClickMenu,node);$event.stopPropagation();"
    >
      <nz-tree-node-toggle>
        <i style="margin-right: 5px;" nz-icon nzType="caret-down" nzTreeNodeToggleRotateIcon></i>
        <i style="color: #fdca66" nz-icon [nzType]="treeControl.isExpanded(node) ? 'folder-open' : 'folder'"
           nzTheme="outline"></i>
        {{ node.name }}
      </nz-tree-node-toggle>
    </nz-tree-node-option>
  </nz-tree-node>
</nz-tree-view>
  <nz-result *ngIf="error"
             nzStatus="error"
             [nzTitle]="error.code"
             [nzSubTitle]="error.msg">
    <div nz-result-extra>
      <button nz-button nzType="primary">刷新</button>
    </div>
  </nz-result>
</nz-spin>
